\(\int \frac {\sin (x)}{\cot (x)+\csc (x)} \, dx\) [203]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 10, antiderivative size = 6 \[ \int \frac {\sin (x)}{\cot (x)+\csc (x)} \, dx=x-\sin (x) \]

[Out]

x-sin(x)

Rubi [A] (verified)

Time = 0.08 (sec) , antiderivative size = 6, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.300, Rules used = {4477, 2761, 8} \[ \int \frac {\sin (x)}{\cot (x)+\csc (x)} \, dx=x-\sin (x) \]

[In]

Int[Sin[x]/(Cot[x] + Csc[x]),x]

[Out]

x - Sin[x]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2761

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)/((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[g*((g*Cos[e
 + f*x])^(p - 1)/(b*f*(p - 1))), x] + Dist[g^2/a, Int[(g*Cos[e + f*x])^(p - 2), x], x] /; FreeQ[{a, b, e, f, g
}, x] && EqQ[a^2 - b^2, 0] && GtQ[p, 1] && IntegerQ[2*p]

Rule 4477

Int[(cot[(c_.) + (d_.)*(x_)]^(n_.)*(a_.) + csc[(c_.) + (d_.)*(x_)]^(n_.)*(b_.))^(p_)*(u_.), x_Symbol] :> Int[A
ctivateTrig[u]*Csc[c + d*x]^(n*p)*(b + a*Cos[c + d*x]^n)^p, x] /; FreeQ[{a, b, c, d}, x] && IntegersQ[n, p]

Rubi steps \begin{align*} \text {integral}& = \int \frac {\sin ^2(x)}{1+\cos (x)} \, dx \\ & = -\sin (x)+\int 1 \, dx \\ & = x-\sin (x) \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(14\) vs. \(2(6)=12\).

Time = 0.02 (sec) , antiderivative size = 14, normalized size of antiderivative = 2.33 \[ \int \frac {\sin (x)}{\cot (x)+\csc (x)} \, dx=2 \left (\frac {x}{2}-\frac {\sin (x)}{2}\right ) \]

[In]

Integrate[Sin[x]/(Cot[x] + Csc[x]),x]

[Out]

2*(x/2 - Sin[x]/2)

Maple [A] (verified)

Time = 1.35 (sec) , antiderivative size = 7, normalized size of antiderivative = 1.17

method result size
risch \(x -\sin \left (x \right )\) \(7\)
default \(-\frac {2 \tan \left (\frac {x}{2}\right )}{1+\tan \left (\frac {x}{2}\right )^{2}}+2 \arctan \left (\tan \left (\frac {x}{2}\right )\right )\) \(25\)

[In]

int(sin(x)/(cot(x)+csc(x)),x,method=_RETURNVERBOSE)

[Out]

x-sin(x)

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 6, normalized size of antiderivative = 1.00 \[ \int \frac {\sin (x)}{\cot (x)+\csc (x)} \, dx=x - \sin \left (x\right ) \]

[In]

integrate(sin(x)/(cot(x)+csc(x)),x, algorithm="fricas")

[Out]

x - sin(x)

Sympy [F]

\[ \int \frac {\sin (x)}{\cot (x)+\csc (x)} \, dx=\int \frac {\sin {\left (x \right )}}{\cot {\left (x \right )} + \csc {\left (x \right )}}\, dx \]

[In]

integrate(sin(x)/(cot(x)+csc(x)),x)

[Out]

Integral(sin(x)/(cot(x) + csc(x)), x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 38 vs. \(2 (6) = 12\).

Time = 0.34 (sec) , antiderivative size = 38, normalized size of antiderivative = 6.33 \[ \int \frac {\sin (x)}{\cot (x)+\csc (x)} \, dx=-\frac {2 \, \sin \left (x\right )}{{\left (\frac {\sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + 1\right )} {\left (\cos \left (x\right ) + 1\right )}} + 2 \, \arctan \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right ) \]

[In]

integrate(sin(x)/(cot(x)+csc(x)),x, algorithm="maxima")

[Out]

-2*sin(x)/((sin(x)^2/(cos(x) + 1)^2 + 1)*(cos(x) + 1)) + 2*arctan(sin(x)/(cos(x) + 1))

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 18 vs. \(2 (6) = 12\).

Time = 0.29 (sec) , antiderivative size = 18, normalized size of antiderivative = 3.00 \[ \int \frac {\sin (x)}{\cot (x)+\csc (x)} \, dx=x - \frac {2 \, \tan \left (\frac {1}{2} \, x\right )}{\tan \left (\frac {1}{2} \, x\right )^{2} + 1} \]

[In]

integrate(sin(x)/(cot(x)+csc(x)),x, algorithm="giac")

[Out]

x - 2*tan(1/2*x)/(tan(1/2*x)^2 + 1)

Mupad [B] (verification not implemented)

Time = 23.78 (sec) , antiderivative size = 6, normalized size of antiderivative = 1.00 \[ \int \frac {\sin (x)}{\cot (x)+\csc (x)} \, dx=x-\sin \left (x\right ) \]

[In]

int(sin(x)/(cot(x) + 1/sin(x)),x)

[Out]

x - sin(x)